<?php

namespace App\Engine\map;

use App\Engine\BaseCommon;
use App\Models\Sys as SysConfig;

class Map
{
    private $common;

    public function __construct()
    {
        $this->common=new BaseCommon();
    }

    /**坐标获取详细地址
     * @param $position
     * @return bool|string
     */
    public function regeo($position)
    {
        $map_key=SysConfig::getValue('gd_map_key');
        $url="https://restapi.amap.com/v3/geocode/regeo?key={$map_key}&location={$position[0]},{$position[1]}";
        $res=$this->common->curl_get($url);
        $res=json_decode($res);
        return $res;
    }
}
